<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>UID测试页面</title>
</head>
<body>
    <h1>UID参数测试</h1>
    <p>当前页面URL: <span id="currentUrl"></span></p>
    <p>获取到的UID值: <span id="uidValue"></span></p>
    
    <script>
        // 获取URL参数的函数
        function getUrlParameter(name) {
            name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
            var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
            var results = regex.exec(window.location.search);
            return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
        }
        
        // 获取uid参数，如果为undefined或空则默认为204
        var uid = getUrlParameter('uid');
        if (uid === undefined || uid === null || uid === '') {
            uid = '204';
        }
        
        // 显示结果
        document.getElementById('currentUrl').textContent = window.location.href;
        document.getElementById('uidValue').textContent = uid;
        
        // 在控制台输出结果
        console.log('Current URL:', window.location.href);
        console.log('UID Value:', uid);
    </script>
</body>
</html>